package com.ruoyi.business.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;

/**
 * 用户优惠卷中间表对象 user_coupon
 * 
 * @author wangziyang
 * @date 2024-09-11
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserCoupon extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键id */
    @TableId
    private Long id;

    /** 用户id */
    @Excel(name = "用户id")
    private Long uId;

    /** 优惠卷id */
    @Excel(name = "优惠卷id")
    private Long cId;

    /** 数量，默认值是1 */
    @Excel(name = "数量，默认值是1")
    private Long num;

    /** 使用开始时间 【领取的时间，优惠券领完可以立刻使用，平台特
色】 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "使用开始时间 【领取的时间，优惠券领完可以立刻使用，平台特色】", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expirationStart;

    /** 使用结束时间 【1个月】 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "使用结束时间 【1个月】", width = 30, dateFormat = "yyyy-MM-dd")
    private Date expirationEnd;

    /** 状态【0未使用、1已使用、2已过期】 */
    @Excel(name = "状态【0未使用、1已使用、2已过期】")
    private int status;

    /** 逻辑删除字段 */
    @Excel(name = "逻辑删除字段")
    @TableLogic
    private Long deleted;
    @TableField(exist = false)
    private Coupon coupon;
    @TableField(exist = false)
    private Date nowTimeLeEndTime;
    @TableField(exist = false)
    private Date nowTimeGtEndTime;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setuId(Long uId) 
    {
        this.uId = uId;
    }

    public Long getuId() 
    {
        return uId;
    }
    public void setcId(Long cId) 
    {
        this.cId = cId;
    }

    public Long getcId() 
    {
        return cId;
    }
    public void setNum(Long num) 
    {
        this.num = num;
    }

    public Long getNum() 
    {
        return num;
    }
    public void setExpirationStart(Date expirationStart) 
    {
        this.expirationStart = expirationStart;
    }

    public Date getExpirationStart() 
    {
        return expirationStart;
    }
    public void setExpirationEnd(Date expirationEnd) 
    {
        this.expirationEnd = expirationEnd;
    }

    public Date getExpirationEnd() 
    {
        return expirationEnd;
    }
    public void setStatus(int status)
    {
        this.status = status;
    }

    public int getStatus()
    {
        return status;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("uId", getuId())
            .append("cId", getcId())
            .append("num", getNum())
            .append("expirationStart", getExpirationStart())
            .append("expirationEnd", getExpirationEnd())
            .append("status", getStatus())
            .toString();
    }
}
